.block-filters {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding: 1em;
  z-index: 10;
  pointer-events: none;

  .filter-bar, .active-tags {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .active-tags {
    flex-wrap: wrap;
    row-gap: 0.25em;
    margin-left: 0.5em;
  }

  .info-badges {
    display: flex;
    flex-direction: row;
    align-items: center;

    &:hover, &:active {
      text-decoration: none;
    }
  }

  .menu-toggle {
    width: 3em;
    min-width: 3em;
    height: 1.8em;
    padding: 0px 1px;
    opacity: 0;
    cursor: pointer;
    color: white;
    background: none;
    border: none;
    border-radius: 0.35em;
    pointer-events: all;
    align-self: normal;
  }

  .filter-menu {
    .filter-row {
      display: flex;
      flex-direction: row;
      justify-content: start;
      align-items: baseline;
    }

    h5 {
      font-size: 0.8rem;
      color: white;
      margin: 0;
      margin-top: 0.5em;
    }
  }

  .filter-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 0.25em;
    margin-bottom: 0.5em;
  }

  .filter-tag {
    font-size: 0.9em;
    background: #181b2daf;
    border: solid 1px var(--primary);
    color: white;
    border-radius: 0.2rem;
    padding: 0.2em 0.5em;
    transition: background-color 300ms;
    margin-right: 0.25em;
    pointer-events: all;

    &.selected {
      background-color: var(--primary);
    }
  }

  &.any-mode {
    .filter-tag {
      border: solid 1px var(--success);
      &.selected {
        background-color: var(--success);
      }
    }
  }

  &.none-mode {
    .filter-tag {
      border: solid 1px var(--danger);
      &.selected {
        background-color: var(--danger);
      }
    }
  }

  .btn-group {
    font-size: 0.9em;
    margin-right: 0.25em;
  }

  .mode-toggle {
    padding: 0.2em 0.5em;
    pointer-events: all;
    line-height: 1.5;
    background: #181b2daf;

    &:first-child {
      border-top-left-radius: 0.2rem;
      border-bottom-left-radius: 0.2rem;
    }
    &:last-child {
      border-top-right-radius: 0.2rem;
      border-bottom-right-radius: 0.2rem;
    }

    &.blue {
      border: solid 1px var(--primary);
      &.active {
        background: var(--primary);
      }
    }
    &.green {
      border: solid 1px var(--success);
      &.active {
        background: var(--success);
      }
    }
    &.red {
      border: solid 1px var(--danger);
      &.active {
        background: var(--danger);
      }
    }
    &.yellow {
      border: solid 1px #bf7815;
      &.active {
        background: #bf7815;
      }
    }
  }

  :host-context(.block-overview-graph:hover) &, &:hover, &:active {
    .menu-toggle {
      opacity: 0.5;
      background: var(--stat-box-bg);

      &:hover {
        opacity: 1;
        background: #181b2d7f;
      }
    }

    &.menu-open, &.filters-active {
      .menu-toggle {
        opacity: 1;
        background: none;

        &:hover {
          background: #181b2d7f;
        }
      }
    }
  }

  &.menu-open, &.filters-active {
    .menu-toggle {
      opacity: 1;
      background: none;

      &:hover {
        background: #181b2d7f;
      }
    }
  }

  &.menu-open {
    pointer-events: all;
    background: #181b2d7f;
  }

  &.small {
    .filter-tag {
      font-size: 0.8em;
    }
  }

  &.vsmall {
    .filter-menu {
      margin-top: 0.25em;
      h5 {
        display: none;
      }
    }
    .filter-tag {
      font-size: 0.7em;
    }
    .mode-toggle {
      font-size: 0.7em;
      margin-bottom: 5px;
      margin-top: 2px;
    }
  }

  &.tiny {
    .filter-tag {
      font-size: 0.5em;
    }
  }
}